package done.easy_001_100;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * 9. Palindrome Number 回文数字
 * Example 1:
 * <p>
 * Input: 121
 * Output: true
 * Example 2:
 * <p>
 * Input: -121
 * Output: false
 *
 * @author 大硕
 * 2019-03-20 11:27 PM
 **/
@Slf4j
public class PalindromeNumber {

    @SuppressWarnings("all")
    public boolean isPalindrome(int x) {
        //190320 first
        return true;
    }

    @Test
    public void test() {
        log.info("result:{}", isPalindrome(12321));
    }

}




























/*
public boolean isPalindrome(int x) {
    if (x < 0 || (x % 10 == 0 && x != 0)) return false;

    int revertNum = 0;

    while (x > revertNum) {
        revertNum = revertNum * 10 + x % 10;
        x /= 10;
    }
    // 奇数位 x == reverNum /10 (忽略了中间的一位),  偶数位  x == reverNum
    return x == revertNum || x == revertNum / 10;
}
*/

